\(\int x^2 (1+x)^{3/2} (1-x+x^2)^{3/2} \, dx\) [497]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 23 \[ \int x^2 (1+x)^{3/2} \left (1-x+x^2\right )^{3/2} \, dx=\frac {2}{15} (1+x)^{5/2} \left (1-x+x^2\right )^{5/2} \]

[Out]

2/15*(1+x)^(5/2)*(x^2-x+1)^(5/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.043, Rules used = {927} \[ \int x^2 (1+x)^{3/2} \left (1-x+x^2\right )^{3/2} \, dx=\frac {2}{15} (x+1)^{5/2} \left (x^2-x+1\right )^{5/2} \]

[In]

Int[x^2*(1 + x)^(3/2)*(1 - x + x^2)^(3/2),x]

[Out]

(2*(1 + x)^(5/2)*(1 - x + x^2)^(5/2))/15

Rule 927

Int[(x_)^2*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(d + e*x)^(
m + 1)*((a + b*x + c*x^2)^(p + 1)/(c*e*(m + 2*p + 3))), x] /; FreeQ[{a, b, c, d, e, m, p}, x] && EqQ[b*e*(m +
p + 2) + 2*c*d*(p + 1), 0] && EqQ[b*d*(p + 1) + a*e*(m + 1), 0] && NeQ[m + 2*p + 3, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {2}{15} (1+x)^{5/2} \left (1-x+x^2\right )^{5/2} \\ \end{align*}

Mathematica [A] (verified)

Time = 10.03 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00 \[ \int x^2 (1+x)^{3/2} \left (1-x+x^2\right )^{3/2} \, dx=\frac {2}{15} (1+x)^{5/2} \left (1-x+x^2\right )^{5/2} \]

[In]

Integrate[x^2*(1 + x)^(3/2)*(1 - x + x^2)^(3/2),x]

[Out]

(2*(1 + x)^(5/2)*(1 - x + x^2)^(5/2))/15

Maple [A] (verified)

Time = 0.56 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.78

method result size
gosper \(\frac {2 \left (1+x \right )^{\frac {5}{2}} \left (x^{2}-x +1\right )^{\frac {5}{2}}}{15}\) \(18\)
default \(\frac {2 \sqrt {1+x}\, \sqrt {x^{2}-x +1}\, \left (x^{6}+2 x^{3}+1\right )}{15}\) \(28\)
risch \(\frac {2 \sqrt {1+x}\, \sqrt {x^{2}-x +1}\, \left (x^{6}+2 x^{3}+1\right )}{15}\) \(28\)
elliptic \(\frac {\sqrt {1+x}\, \sqrt {x^{2}-x +1}\, \sqrt {\left (1+x \right ) \left (x^{2}-x +1\right )}\, \left (\frac {2 x^{6} \sqrt {x^{3}+1}}{15}+\frac {4 x^{3} \sqrt {x^{3}+1}}{15}+\frac {2 \sqrt {x^{3}+1}}{15}\right )}{x^{3}+1}\) \(72\)

[In]

int(x^2*(1+x)^(3/2)*(x^2-x+1)^(3/2),x,method=_RETURNVERBOSE)

[Out]

2/15*(1+x)^(5/2)*(x^2-x+1)^(5/2)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.17 \[ \int x^2 (1+x)^{3/2} \left (1-x+x^2\right )^{3/2} \, dx=\frac {2}{15} \, {\left (x^{6} + 2 \, x^{3} + 1\right )} \sqrt {x^{2} - x + 1} \sqrt {x + 1} \]

[In]

integrate(x^2*(1+x)^(3/2)*(x^2-x+1)^(3/2),x, algorithm="fricas")

[Out]

2/15*(x^6 + 2*x^3 + 1)*sqrt(x^2 - x + 1)*sqrt(x + 1)

Sympy [F]

\[ \int x^2 (1+x)^{3/2} \left (1-x+x^2\right )^{3/2} \, dx=\int x^{2} \left (x + 1\right )^{\frac {3}{2}} \left (x^{2} - x + 1\right )^{\frac {3}{2}}\, dx \]

[In]

integrate(x**2*(1+x)**(3/2)*(x**2-x+1)**(3/2),x)

[Out]

Integral(x**2*(x + 1)**(3/2)*(x**2 - x + 1)**(3/2), x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.17 \[ \int x^2 (1+x)^{3/2} \left (1-x+x^2\right )^{3/2} \, dx=\frac {2}{15} \, {\left (x^{6} + 2 \, x^{3} + 1\right )} \sqrt {x^{2} - x + 1} \sqrt {x + 1} \]

[In]

integrate(x^2*(1+x)^(3/2)*(x^2-x+1)^(3/2),x, algorithm="maxima")

[Out]

2/15*(x^6 + 2*x^3 + 1)*sqrt(x^2 - x + 1)*sqrt(x + 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 173 vs. \(2 (17) = 34\).

Time = 0.31 (sec) , antiderivative size = 173, normalized size of antiderivative = 7.52 \[ \int x^2 (1+x)^{3/2} \left (1-x+x^2\right )^{3/2} \, dx=\frac {2}{45045} \, {\left ({\left ({\left (7 \, {\left (3 \, {\left (11 \, {\left (13 \, x - 80\right )} {\left (x + 1\right )} + 3165\right )} {\left (x + 1\right )} - 16442\right )} {\left (x + 1\right )} + 121227\right )} {\left (x + 1\right )} - 80187\right )} {\left (x + 1\right )} + 34077\right )} \sqrt {{\left (x + 1\right )}^{2} - 3 \, x} \sqrt {x + 1} + \frac {2}{45045} \, {\left ({\left (5 \, {\left (7 \, {\left (9 \, {\left (11 \, x - 57\right )} {\left (x + 1\right )} + 1601\right )} {\left (x + 1\right )} - 15837\right )} {\left (x + 1\right )} + 65172\right )} {\left (x + 1\right )} - 34077\right )} \sqrt {{\left (x + 1\right )}^{2} - 3 \, x} \sqrt {x + 1} + \frac {2}{315} \, {\left ({\left (5 \, {\left (7 \, x - 23\right )} {\left (x + 1\right )} + 258\right )} {\left (x + 1\right )} - 213\right )} \sqrt {{\left (x + 1\right )}^{2} - 3 \, x} \sqrt {x + 1} + \frac {2}{105} \, {\left (3 \, {\left (5 \, x - 12\right )} {\left (x + 1\right )} + 71\right )} \sqrt {{\left (x + 1\right )}^{2} - 3 \, x} \sqrt {x + 1} \]

[In]

integrate(x^2*(1+x)^(3/2)*(x^2-x+1)^(3/2),x, algorithm="giac")

[Out]

2/45045*(((7*(3*(11*(13*x - 80)*(x + 1) + 3165)*(x + 1) - 16442)*(x + 1) + 121227)*(x + 1) - 80187)*(x + 1) +
34077)*sqrt((x + 1)^2 - 3*x)*sqrt(x + 1) + 2/45045*((5*(7*(9*(11*x - 57)*(x + 1) + 1601)*(x + 1) - 15837)*(x +
 1) + 65172)*(x + 1) - 34077)*sqrt((x + 1)^2 - 3*x)*sqrt(x + 1) + 2/315*((5*(7*x - 23)*(x + 1) + 258)*(x + 1)
- 213)*sqrt((x + 1)^2 - 3*x)*sqrt(x + 1) + 2/105*(3*(5*x - 12)*(x + 1) + 71)*sqrt((x + 1)^2 - 3*x)*sqrt(x + 1)

Mupad [B] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.09 \[ \int x^2 (1+x)^{3/2} \left (1-x+x^2\right )^{3/2} \, dx=\frac {2\,\sqrt {x+1}\,{\left (x^2-x+1\right )}^{5/2}\,\left (x^2+2\,x+1\right )}{15} \]

[In]

int(x^2*(x + 1)^(3/2)*(x^2 - x + 1)^(3/2),x)

[Out]

(2*(x + 1)^(1/2)*(x^2 - x + 1)^(5/2)*(2*x + x^2 + 1))/15